# 导包
import jsonschema

#准备测试数据
data={
    "success": True,
    "code": 10000,
    "message": "操作成功",
    "money": 6.66,
    "address": None,
    "data": {
        "name": "tom"
    },
    "luckyNumber": [6, 8, 9]
}
# 定义规则
schema1 = {
    "type":"object",
    "properties":{
        "success" :{"type":"boolean"},
        "code":{"type":"integer"},
        "message":{"type":"string"},
        "money":{"type":"number"},
        "address":{"type":"null"},
        "data":{
            "type":"object",
            "properties": {
                "name": {"type": "string"},
            },
            "required": ["name"]
        },
        "luckyNumber":{"type":"array"},
    },
    "required":["success","code","message","money","address","data","luckyNumber"]
}

resp = jsonschema.validate(instance=data,schema=schema1)
print(resp)